//
// Created by liaohailong on 2025/4/11.
//

#ifndef HELLOVIDEOCACHE_HELLONETWORKFETCHER_HPP
#define HELLOVIDEOCACHE_HELLONETWORKFETCHER_HPP


#include "HelloDataFetcher.hpp"
#include "HelloDownloader.hpp"

/**
 * create by liaohailong
 * 2025/4/11 21:47
 * desc: 请求网络数据
 */
class HelloNetworkFetcher : public HelloDataFetcher
{
public:
    /**
     * 请求网络HTTP/HTTPS,获取数据,写回客户端
     * @param request 客户端请求参数
     * @param range 请求部分资源范围
     * @param write2Cache 请求到网络数据之后是否需要写入本地缓存?
     */
    explicit HelloNetworkFetcher(const std::shared_ptr<HelloCacheManager> &cache,
                                 const std::shared_ptr<HelloHttpRequest> &request,
                                 const std::shared_ptr<HelloRange> &range);

    ~HelloNetworkFetcher() override;

    bool run(const std::shared_ptr<HelloHttpRequest> &request) override;

private:
};


#endif //HELLOVIDEOCACHE_HELLONETWORKFETCHER_HPP
